<?php

/**
 * Created by PhpStorm.
 * User: izbol
 * Date: 2017/3/30
 * Time: 19:45
 */
class db{
    function __construct(){

        $this->mysql=new mysqli('localhost','root','','blog');
        if ($this->mysql->connect_error) {
            die('Connect Error (' . $this->mysql->connect_errno . ') '
                . $this->mysql->connect_error);
        }
        $this->mysql->query('SET NAMES UTF8');
    }
    function query($sql){
            return $this->mysql->query($sql);
    }

}